package org.NooLab.openNLP.components;

import org.NooLab.nlp.structures.NLPresults;


public class ActiveProcessor implements Runnable{
	// created in LinguisticProcessor
	
	LanguageProcessorCore lProc;
	
	Thread lpcActiveProc;
	
	NLPresults nlpResults;
	String text="",processguid="";
	
	// ========================================================================
	public ActiveProcessor( LanguageProcessorCore lProc, String processguid, 
						    NLPresults nlpResults, String text) {
		// 
		this.nlpResults = nlpResults;
		this.text = text;
		this.processguid = processguid;
		this.lProc = lProc;
		
		lpcActiveProc = new Thread(this,"lpcActiveProc");
		lpcActiveProc.start();
	}
	// ========================================================================
	
	
	private void perform(){

		lProc.setResultsBay( processguid, nlpResults ) ; 
		lProc.performParse( processguid, text );
	}

	@Override
	public void run() {
		// 
		
		perform();
	}

}
